Page({
  data: {
    swiperList: [], //存放轮播图的图片的数组
    catesList: [], //存放分类导航数据
    floorList: [], //楼层数据
  },
  onLoad() {
    // 1. 发送异步请求获取轮播图数据
    this.getSwiperData();
    this.getCatesList();
    this.getFloorList();
  },
  getFloorList() {
    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/floordata',
      success: (result) => {
        this.setData({
          floorList: result.data.message
        });
      },
    })
  },
  getCatesList() {
    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
      success: (result) => {
        this.setData({
          catesList: result.data.message
        });
      },
    });
  },
  getSwiperData() {

    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
      success: (result) => {
        // console.log(result.data.message[0]);
        this.setData({
          swiperList: result.data.message
        });
      },
    });
  },
})